<template name="noData">
	<view class="display column noDataAre">
		<image :src="noDataImg" mode="widthFix" :style="{width: imgWidth}"></image>
		<text style="margin: 20rpx 0 40rpx;">{{noDataText}}</text>
		<button class="display themeBdColor btn" v-if="noDataType == 'car' || noDataType == 'search' || noDataType == 'goodsCollect' || noDataType == 'shopCollect'" @click="btnClick">去逛逛</button>
	</view>
</template>

<script>
	export default {
		name: 'noData',
		props: ['noDataType'],
		data() {
			return {
				
			};
		},
		computed:{
			noDataImg(){
				let img =  this.noDataType=='car'?'/static/images/icon/car-no.png':'/static/images/icon/noData.png'
				return img
			},
			noDataText(){
				let text = ''
				switch (this.noDataType){
					case 'car':
						text = '购物车是空的'
						break;
					case 'search':
						text = '没有找到相关的商品哦~'
						break;
					case 'classGoods':
						text = '暂时还没有本类商品哦~'
						break;
					case 'shopGoods':
						text = '本店暂时还没有商品哦~敬请期待！'
						break;
					case 'goods': 
						text = '暂时还没有商品哦~敬请期待！'
						break;
					case 'shopCar':
						text = '购物车是空的'
						break;
					case 'earnings':
						text = '暂时还没有资金列表~~'
						break;
					case 'evaluation':
						text = '暂时还没有评论列表~~'
						break;
					case 'goodsCollect':
						text = '暂时还没有收藏商品~~'
						break;
					case 'shopCollect':
						text = '暂时还没有收藏商铺~~'
						break;
					case 'message':
						text = '您还没有收到消息哦~~'
						break;refundOrder
					case 'message':
						text = '您没有退款订单~~'
						break;
					case 'integral':
						text = '您还没有积分~~'
						break;
				}
				return text
			},
			imgWidth(){
				let width = this.noDataType=='car'?'90rpx':'303rpx'
				return width
			}
		},
		methods:{
			btnClick(){
				uni.switchTab({
					url: '/pages/index/index'
				})
			}
		}
	}
</script>

<style lang="scss">
	.noDataAre{
		@include width;
		@include flex-align-justify;
		@include font($fontSize,$blackColor);
		.btn{
			@include widthHeight(240rpx,70rpx);
			@include borderR(35rpx);
			@include font($fontSize + 2rpx);
			@include flex-align-justify;
		}
	}
</style>
